package com.test.burnincash.aaahpoppomelo.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.test.burnincash.R;
import com.test.burnincash.aaahpoppomelo.activity.CustomerManagementActivity_hpoppomelo;
import com.test.burnincash.aaahpoppomelo.activity.OrderDownloadActivity_hpoppomelo;
import com.test.burnincash.aaahpoppomelo.activity.OrderManagementActivity_hpoppomelo;
import com.test.burnincash.aaahpoppomelo.base.BaseActivity_hpoppomelo;
import com.test.burnincash.aaahpoppomelo.dialog.LogoutDialog_hpoppomelo;
import com.test.burnincash.dialog_burnin.LogoutDialog_burnin;

public class UserFragment_hpoppomelo extends Fragment {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_user_hpoppomelo, container, false);
        init(view);
        return view;
    }

    private void init(View view){

        view.findViewById(R.id.fragment_user_layout_order_management).setOnClickListener(v -> startActivity(new Intent(requireContext(), OrderManagementActivity_hpoppomelo.class)));

        view.findViewById(R.id.fragment_user_layout_customer_management).setOnClickListener(v -> startActivity(new Intent(requireContext(), CustomerManagementActivity_hpoppomelo.class)));

        view.findViewById(R.id.fragment_user_layout_order_download).setOnClickListener(v -> startActivity(new Intent(requireContext(), OrderDownloadActivity_hpoppomelo.class)));

        Context context = requireContext();
        if (context instanceof BaseActivity_hpoppomelo)
            view.findViewById(R.id.fragment_user_ib_louout).setOnClickListener(v -> new LogoutDialog_hpoppomelo((BaseActivity_hpoppomelo) context).show());

    }

}